* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.categories-sidebar {
    width: 280px;
    background-color: white;
    padding: 25px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    border-right: 1px solid #e0e6ed;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容区域滚动 */
    padding: 0; /* 移除内边距 */
    background-color: #f8f9fa;
    width: calc(100% - 280px); /* 减去侧边栏宽度 */
}
.container {
    position: relative;
    height: 100%; /* 填充整个高度 */
    width: 100%;
    margin: 0;
    padding: 0; /* 移除内边距 */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止容器滚动 */
}


h1, h2 {
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 25px;
    position: relative;
}

h2 {
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #4dabf7;
}

.mode-selector {
    /*margin-bottom: 30px;*/
    width: 28%;
    display: flex;
    gap: 10px;
    background: #f1f3f5;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e0e6ed;
}

.mode-btn {
    padding: 12px 30px;
    background-color: transparent;
    color: #495057;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.mode-btn.active {
    background-color: #4dabf7;
    color: white;
    box-shadow: 0 4px 10px rgba(77, 171, 247, 0.3);
}

.mode-btn:hover {
    background-color: #e9ecef;
}

.mode-btn.active:hover {
    background-color: #339af0;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
    width: 100%;
}

.category-btn {
    padding: 14px 20px;
    background-color: white;
    color: #495057;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
#review-mistakes-btn {
    background-color: #fff4e6;
    color: #e67700;
    border: 1px solid #ffd8a8;
    margin-top: 20px;
}

#review-mistakes-btn:hover {
    background-color: #ffe8cc;
}

#review-mistakes-btn.active {
    background-color: #ffa94d;
    color: white;
    border-color: #ff922b;
    box-shadow: 0 5px 15px rgba(255, 169, 77, 0.3);
}
.category-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #d0d7e2;
}

.category-btn.active {
    background-color: #4dabf7;
    color: white;
    border-color: #4dabf7;
    box-shadow: 0 5px 15px rgba(77, 171, 247, 0.3);
}

.word-module {
    flex: 1; /* 填充可用空间 */
    width: 100%;
    border-radius: 0; /* 移除圆角 */
    box-shadow: none; /* 移除阴影 */
    padding: 30px;
    min-height: auto; /* 移除固定高度 */
    border: none; /* 移除边框 */
    overflow-y: auto; /* 只在单词模块内滚动 */
}

.word-module.quiz-mode {
    background-color: #f8fafc;
    border: 1px solid #d6e4ff;
}

/*.word-module:hover {*/
/*    transform: translateY(-5px);*/
/*    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);*/
/*}*/

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 20px;
}

.word-title {
    font-size: 48px;
    font-weight: 600;
    color: #212529;
    flex-grow: 1;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.word-category {
    background-color: #e7f5ff;
    color: #1971c2;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.word-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 允许内容滚动 */
    padding-bottom: 20px; /* 添加底部内边距 */
}

.word-pos {
    color: #e64980;
    font-style: italic;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.word-definition {
    color: #495057;
    margin-bottom: 25px;
    font-size: 24px;
    min-height: 30px;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.word-example {
    color: #2b8a3e;
    font-style: italic;
    border-left: 4px solid #40c057;
    padding-left: 20px;
    margin-top: 30px;
    font-size: 18px;
    line-height: 1.6;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 30px 0;
}

.option-btn {
    padding: 18px;
    background-color: white;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 17px;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.option-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.1);
    border-color: #d0d7e2;
}

.option-btn.correct {
    background-color: #40c057;
    color: white;
    border-color: #2b8a3e;
    box-shadow: 0 4px 8px rgba(64, 192, 87, 0.3);
}

.option-btn.incorrect {
    background-color: #fa5252;
    color: white;
    border-color: #e03131;
    box-shadow: 0 4px 8px rgba(250, 82, 82, 0.3);
}

.word-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.word-control-btn {
    padding: 10px 20px;
    background-color: #4dabf7;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(77, 171, 247, 0.3);
}

.word-control-btn:hover {
    background-color: #339af0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(77, 171, 247, 0.4);
}

.word-control-btn.show {
    background-color: #40c057;
}

.word-control-btn.show:hover {
    background-color: #2b8a3e;
}

.word-control-btn:disabled {
    background-color: #ced4da;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}


.progress {
    margin-top: 25px;
    font-size: 16px;
    color: #868e96;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.result-message {
    /*margin: 25px 0;*/
    font-size: 20px;
    font-weight: 600;
    /*min-height: 30px;*/
    text-align: center;
    letter-spacing: 0.5px;
}

.correct-message {
    color: #2b8a3e;
}

.incorrect-message {
    color: #e03131;
}

.loading {
    text-align: center;
    font-size: 17px;
    color: #868e96;
    margin: 40px 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.error {
    color: #e03131;
    text-align: center;
    margin: 25px 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .categories-sidebar {
        width: 100%;
        box-shadow: none;
        border-bottom: 1px solid #e0e6ed;
        overflow-y: visible;
        padding: 20px;
    }

    .content-area {
        padding: 20px;
        max-width: 100%;
    }

    .container {
        padding: 15px;
    }

    .word-module {
        padding: 20px;
        min-height: 400px;
    }
    #word-viewer {
        height: 100%; /* 填充整个高度 */
        display: flex;
        flex-direction: column;
        overflow: hidden; /* 防止查看器滚动 */
    }
    .options-container {
        grid-template-columns: 1fr;
    }

    .word-title {
        font-size: 28px;
    }

    .word-definition {
        font-size: 19px;
    }

}
.top-right-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

/* 主页按钮样式 */
.home-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: white;
    color: #495057;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e0e6ed;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.home-button:hover {
    background-color: #f1f3f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
/* 添加计时器样式 */
.timer-container {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
    color: #495057;
}

#timer {
    background-color: #f1f3f5;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    border: 1px solid #e0e6ed;
}
